package me.xiaoyan.java.chapter12;

public class Pig {
	String name = "小白";
	//时间
	int time = 7;
	/**
	 * 吃饭
	 */
	public void eat()
	{
		if(isHungry()){
			System.out.println(name + "正在吃饭，你要不要来一点儿!");
		}else{
			System.out.println(name + "还没有饿，我要拱猪槽");
		}
	}
	
	/**
	 * 睡觉
	 */
	public void sleep()
	{
		System.out.println(name + "正在睡觉，我梦见好像要被打了!");
	}
	
	
	/**
	 * 是否已经饿了
	 */
	public boolean isHungry()
	{
		if(time > 9){
			//饿了
			return true;
		}else{
			//没有饿
			return false;
		}
	}
	
	public String[] getInfo()
	{
		String[] infos = {"性别:不知道","年龄:1岁","体重:350"};
		return infos;
	}
	
	
	public static void main(String[] args) {
		Pig xiaobai = new Pig();//创建一个小文
		xiaobai.name = "小文";
		xiaobai.eat();//让小文吃饭
		xiaobai.sleep();//让小文睡觉
	}
}
